<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>vip会员验证</h2>
    </div>
    <div class="check">
        <input type="text" class="text input-mid form-control" placeholder="请输入会员码 / 扫描用户二维码" name="vipcode">
        <button class="btn ajax-post hidden button-submit btn-primary" style="margin-top:-10px" onclick="checkCode()">验证</button>
    </div>
</block>

<block name="script">
<script type="text/javascript">
    $("input[name='vipcode']").focus();
    function checkCode(){
        var vipcode = $("input[name='vipcode']").val();
        $.ajax({
            type : 'get',
            url : 'index.php?s=Admin/Vip/codeCheck',
            data : { code : vipcode},
            success: function(data){
              alert(data);
              window.location.reload();
            }
        })
    }
</script>
</block>
